Slim down the `cargo --list` test
authorAlex Crichton <alex@alexcrichton.com>
Tue, 2 Sep 2014 16:51:48 +0000 (09:51 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Tue, 2 Sep 2014 18:49:36 +0000 (11:49 -0700)
commitf3cb4232d85618f58d70db2a12655011373103c1
treecc567257bcb1b9e8f2674a4b6f02a81b9939869c
parent70446f9e45c37a1b18126769f135c173a2b54e55
Slim down the `cargo --list` test

This test has been flaky on the bots for quite some time now, and the cause has
now been discovered. The root cause of the failure is that the execve for the
`cargo --list` command was failing with ETXTBUSY. In querying the manpage, this
means:

    Executable was open for writing by one or more processes.

This error can be explained by the following trace:

1. Thread A, running the `cargo --list` test, opens the destination executable
   for writing because it's copying the current executable into a different
   location.
2. Thread B, some other test, forks the process. The file descriptor of the
   destination executable of thread A is now duplicated in this process.
3. Thread A closes all files and such, and then goes to fork/exec
   `cargo --list`.
4. Thread B has not had time to close all its descriptors. so it still has the
   executable open for writing, causing the `execve` of thread A to fail.

This commit just removes these tested portions of the test, only testing that
cargo probes PATH.
tests/test_cargo.rs